//
//  SelectBankCardViewController.m
//  Kjs-iOS
//
//  Created by 江伟 on 16/6/28.
//  Copyright © 2016年 jmhz. All rights reserved.
//

#import "SelectBankCardViewController.h"
#import "BankCardTypeCell.h"

@interface SelectBankCardViewController ()<UITableViewDataSource,UITableViewDelegate>

@end

@implementation SelectBankCardViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.navigationItem setTitle:@"选择银行卡"];
    self.bankCardTableView.dataSource = self;
    self.bankCardTableView.delegate = self;
    self.bankCardTableView.separatorStyle = UITableViewCellSeparatorStyleNone;

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


#pragma mark - UITableViewSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 24;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    BankCardTypeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BankCardTypeCell"];
    cell.type = indexPath.row;
    return cell;
}

#pragma mark - UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    self.selectBankCard(indexPath.row);
    [self dismiss:YES];
}


@end
